home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / gpt32src.zip / REGIS.TRM < prev    next >
Text File  |  1992-03-25  |  3KB  |  146 lines

  1. /*
  2.  * $Id: regis.trm,v 3.26 92/03/24 22:35:42 woo Exp Locker: woo $
  3.  */
  4.  
  5. /* GNUPLOT - regis.trm */
  6. /*
  7.  * Copyright (C) 1990, 1991, 1992   
  8.  *
  9.  * Permission to use, copy, and distribute this software and its
  10.  * documentation for any purpose with or without fee is hereby granted, 
  11.  * provided that the above copyright notice appear in all copies and 
  12.  * that both that copyright notice and this permission notice appear 
  13.  * in supporting documentation.
  14.  *
  15.  * Permission to modify the software is granted, but not the right to
  16.  * distribute the modified code.  Modifications are to be distributed 
  17.  * as patches to released version.
  18.  *  
  19.  * This software  is provided "as is" without express or implied warranty.
  20.  * 
  21.  * This file is included by ../term.c.
  22.  *
  23.  * This terminal driver supports:
  24.  *  REGIS devices
  25.  *
  26.  * AUTHORS
  27.  *  Colin Kelley, Thomas Williams
  28.  * 
  29.  * send your comments or suggestions to (info-gnuplot@ames.arc.nasa.gov).
  30.  * 
  31.  */
  32.  
  33. #define REGISXMAX 800             
  34. #define REGISYMAX 440
  35.  
  36. #define REGISXLAST (REGISXMAX - 1)
  37. #define REGISYLAST (REGISYMAX - 1)
  38.  
  39. #define REGISVCHAR        20      
  40. #define REGISHCHAR        9
  41. #define REGISVTIC        8
  42. #define REGISHTIC        6
  43.  
  44. int REGISang = 0;
  45.  
  46. REGISinit()
  47. {
  48.     fprintf(outfile,"\033[r\033[24;1H");
  49. /*                   1     2
  50.     1. reset scrolling region
  51.     2. locate cursor on bottom line
  52. */
  53. }
  54.  
  55.  
  56. /* thanks to calmasd!dko (Dan O'Neill) for adding S(E) for vt125s */
  57. REGISgraphics()
  58. {
  59.     fprintf(outfile,"\033[2J\033P1pS(C0)S(E)");
  60. /*                   1      2      3    4   5
  61.     1. clear screen
  62.     2. enter ReGIS graphics
  63.     3. turn off graphics diamond cursor
  64.     4. clear graphics screen
  65. */
  66.     (void) REGIStext_angle(0); /* select text size and angle */ 
  67. }
  68.  
  69.  
  70. REGIStext()
  71. {
  72.     fprintf(outfile,"\033\\\033[24;1H");
  73. /*                       1    2
  74.     1. Leave ReGIS graphics mode
  75.      2. locate cursor on last line of screen
  76. */
  77. }
  78.  
  79.  
  80. REGISlinetype(linetype)
  81. int     linetype;
  82. {
  83.       /* This will change color in order G,R,B,G-dot,R-dot,B-dot */
  84. static int in_map[9 + 2] = {2, 2, 3, 2, 1, 3, 2, 1, 3, 2, 1};
  85. static int lt_map[9 + 2] = {1, 4, 1, 1, 1, 4, 4, 4, 6, 6, 6};
  86.  
  87.     if (linetype >= 9)
  88.         linetype %= 9;
  89.     fprintf(outfile, "W(I%d)", in_map[linetype + 2]);
  90.     fprintf(outfile, "W(P%d)", lt_map[linetype + 2]);
  91. }
  92.  
  93.  
  94. REGISmove(x,y)
  95. int x,y;
  96. {
  97.     fprintf(outfile,"P[%d,%d]",x,REGISYLAST-y,x,REGISYLAST-y);
  98. }
  99.  
  100.  
  101. REGISvector(x,y)
  102. int x,y;
  103. {
  104.     fprintf(outfile,"v[]v[%d,%d]",x,REGISYLAST - y);
  105. /* the initial v[] is needed to get the first pixel plotted */
  106. }
  107.  
  108.  
  109. /* put_text and text_angle by rjl */
  110. REGISput_text(x,y,str)
  111. int x, y;
  112. char *str;
  113. {
  114.     if (REGISang==1)
  115.         REGISmove(x-REGISVCHAR/2-1,y);
  116.     else
  117.         REGISmove(x,y+REGISVCHAR/2-1);
  118.     (void) putc('T',outfile); (void) putc('\'',outfile);
  119.     while (*str) {
  120.         (void) putc(*str,outfile);
  121.         if (*str == '\'')
  122.             (void) putc('\'',outfile);    /* send out another one */
  123.         str++;
  124.     }
  125.     (void) putc('\'',outfile);
  126. }
  127.  
  128.  
  129. int REGIStext_angle(ang)
  130. int ang;
  131. {
  132.     REGISang = ang;
  133.     if (ang == 1)
  134.         fputs("T(D90,S1)",outfile);
  135.     else
  136.         fputs("T(D0,S1)",outfile);
  137.     return TRUE;
  138. }
  139.  
  140.  
  141. REGISreset()
  142. {
  143.     fprintf(outfile,"\033[2J\033[24;1H");
  144. }
  145.  
  146.